This sample code shows the use of the ClearError Method (Report Object). Modify the following sample code to fit your needs.
Dim crystlApplication As CRPEAuto.Application
Dim crystlReport As CRPEAuto.Report
Dim test As Index
Private Sub Command1_Click()
Set crystlApplication = CreateObject("Crystal.CRPE.Application")
Set crystlReport = crystlApplication.OpenReport _
("c:\crw\reports\xtreme\wwsales.rpt")
ClearError
End Sub
Sub ClearError()
If crystlReport.LastErrorCode <> 0 Then
MsgBox test & ". Unexpected report error: " & _
crystlReport.LastErrorCode & "->" & crystlReport.LastErrorString
End If
Call ResetErr
crystlReport.ClearError
Resume Next
End Sub
Seagate Software IMG Holdings, Inc. http://www.seagatesoftware.com Support services: http://support.seagatesoftware.com |